import React from 'react'
import ReactDOM from 'react-dom'

import AppUI from './components/appui'



import  {createStore} from 'redux'   //准备创建 store

import  {Counters} from './reudx/reducers'


const  store=createStore(Counters)  // 创建完成一个store


console.log(store.getState())



ReactDOM.render(<AppUI  store={store}/> ,document.getElementById('root'))

store.subscribe(function() {  //监听store发生变化后重新去渲染 dom组件
    ReactDOM.render(<AppUI  store={store}/> ,document.getElementById('root'))
})